
module aftermath.utils {
    

    export function classof(o) {
        if (o === null) {
            return 'null';
        }
        if (o === undefined) {
            return 'undefined';
        }
        return Object.prototype.toString.call(o).slice(8, -1).toLowerCase();
    }

    export function isArray(o) {
        return classof(o) === 'array';
    }

    export function isObject(o) {
        return classof(o) === 'object';
    }

    export function isString(o) {
        return classof(o) === 'string';
    }

    export function isNumber(o) {
        return classof(o) === 'number';
    }

    export function isValueArray(o) {
        return isArray(o) && (o.length === 0 || !(isArray(o[0]) || isObject(o[0])));
    }

    export function isDate(o) {
        return classof(o) === 'date';
    }

    export function isexport(o) {
        return classof(o) === 'export function';
    }

    export function isGuid(value) {
        return (typeof value === 'string') && /[a-fA-F\d]{8}-(?:[a-fA-F\d]{4}-){3}[a-fA-F\d]{12}/.test(value);
    }
    
    export function isFunction(o) {
        return classof(o) === 'function';
    }

    export function isEmpty(obj) {
        if (obj === null || obj === undefined) {
            return true;
        }
        for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) {
                return false;
            }
        }
        return true;
    }
   

  
}